package com.ftg.learn.service.impl;

import com.ftg.learn.entity.SysRoleEntity;
import com.ftg.learn.repository.EsNewsRepository;
import com.ftg.learn.service.SysRoleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class SysRoleServiceImpl implements SysRoleService {

    @Resource
    private EsNewsRepository exampleRepository;

    @Override
    public Optional<SysRoleEntity> getRoleById(int id) {
        return exampleRepository.findById(Long.valueOf(id));
    }

    @Override
    public List<SysRoleEntity> getRoleByName(String roleName) {
        return exampleRepository.findByRoleName(roleName);
    }
}
